package com.usefullc.system.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.usefullc.system.entity.WebResult;
import com.usefullc.system.service.MessagePublishService;
import com.usefullc.system.service.SerialNumberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Sampson
 * @date: 2022-01-10 15:28
 */
@RestController
@RequestMapping(path = "/system/test/")
@Api( tags="测试操作管理 ")
public class TestController extends BaseController {

    @Autowired
    private MessagePublishService initDataService;

    @Autowired
    private SerialNumberService serialNumberService;


    @ApiOperationSupport(author = "Sampson@usefullc.com")
    @ApiOperation(value = "测试序号生成", response = WebResult.class)
    @GetMapping(path = "testSerialNumber", produces = "application/json")
    public WebResult testSerialNumber(@RequestParam String tableName, @RequestParam String type) {
        String no = serialNumberService.getSerialNumber(tableName, type);
        return WebResultBuilder.successResult(no);
    }
}
